<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.zpyr.mvc.vo.Carc_evaluation"%>
<%@page import="java.util.List"%>
<%@page import="com.zpyr.mvc.vo.Carc_info"%>
<%@page import="com.zpyr.common.StringUtil"%>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width ,height=device-height , user-scalable=no" />
<title>카센터어플</title>
<script src="/js/common_lib/jquery-1.7.min.js"> </script>
<script src="/js/my_lib/dataStructure.js"> </script>
<script src="/js/carcenter/menu_control.js"> </script>
<!--script src="http://apis.daum.net/maps/maps3.js?apikey=c48ea4fe15ba18e8124bde5151aa22ee11c853fa"> </script-->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"> </script>

<script type="text/javascript" src="/js/common_lib/iscroll-lite.js"> </script>
<script type="text/javascript" src="/js/common_lib/kakaoLink.js"> </script>

<script type="text/javascript" src="/js/carcenter/page_carcenter_info.js"> </script>
<script type="text/javascript" src="/js/carcenter/page_search_around.js"> </script>
<script type="text/javascript" src="/js/carcenter/page_search_name.js"> </script>
<script type="text/javascript" src="/js/carcenter/page_search_list.js"> </script>
<script>
	var map;
	var kakaoLink;
	$(document).ready(function(){
		addupEvent();
		
		// 첫페이지
		bottomNavigation(1);
		browserCheck();
	});
	
	addupEvent = function() {
		$('#addrSearchBtn').click(function(){
			bottomNavigation(1);
		});
		$('#nameSearchBtn').click(function(){
			bottomNavigation(2);
		});
		$('#aroundSearchBtn').click(function(){
			bottomNavigation(3);
		});
		$('#favoriteBtn').click(function(){
			bottomNavigation(4);
		});
		$('#settingBtn').click(function(){
			console.log('5번째 메뉴이동');
		});
		$('#kakaoBtn').click(function(){
			executeKakaoLink();
		});
	};
	
	executeKakaoLink = function() {
		var msg = "자동차정비소 어플 입니다.";
		var url = "http://ocpek2.cafe24.com/carcenter.gcm";
		var appid = "ocpek2.cafe24.com";
		var appver = "0.1";
		var appname = "자동차정비소 어플";
		if(!kakaoLink) {
			kakaoLink = new com.kakao.talk.KakaoLink(appid, appver, url, msg, appname);
		}
		console.log('kakao!');
		kakaoLink.execute();
	};
	
	browserCheck = function() {
		
		var browserKeyWords = new Array('Netscape', 'Safari');

		var isBwCheck = false;
		var thisBwName = '';
		for(var bw in browserKeyWords){
		 
			if(navigator.appName.match(browserKeyWords[bw])!=null){
				isBwCheck = true;
			    thisBwName = navigator.appName;
			    break;
			}
		 
		}
		
		var isAppleCheck = false;
		var thisMobileName = '';
		var mobileKeyWords = new Array('iPhone', 'iPod','iPad');
		for (var word in mobileKeyWords){
			if (navigator.userAgent.match(mobileKeyWords[word]) != null){
		    	isAppleCheck = true;
		        thisMobileName = mobileKeyWords[word];
		        break;
		    }
		}
		 

		var isGoogleCheck = false;
		var mobileKeyWords = new Array('Android');
		for (var word in mobileKeyWords){
			if (navigator.userAgent.match(mobileKeyWords[word]) != null){
		    	isGoogleCheck = true;
		        thisMobileName = mobileKeyWords[word];
		        break;
		    }
		}
		
		if(isAppleCheck) {
			return 'apple';
		}
		else if(isGoogleCheck) {
			return 'google';
		}
		else {
			return 'pc';
		}
		
	};

</script>
<link rel="stylesheet" href="/css/carcenter/common.css" />
<style>
</style>
</head>
<body>
<div id="index_main" style="">
</div>
<div id="footer" class="footer">
	<table style="width:100%; text-align: center;">
	<tr>
	<td width="17%"><img src="/images/icons/list.png" width="40px" alt="주소검색" class="imgBtn" id="addrSearchBtn" /></td>
	<td width="17%"><img src="/images/icons/search2.png" width="40px" alt="명칭검색" class="imgBtn" id="nameSearchBtn" /></td>
	<td width="17%"><img src="/images/icons/locate.png" width="40px" alt="주변검색" class="imgBtn" id="aroundSearchBtn" /></td>
	<td width="17%"><img src="/images/icons/favorites_circle.png" width="40px" alt="즐겨찾기" class="imgBtn" id="favoriteBtn" /></td>
	<td width="16%"><img src="/images/icons/settings3.png" width="40px" alt="설정" class="imgBtn" id="settingBtn" /></td>
	<td width="16%"><input type="button" id="kakaoBtn" value="KaKao" class="button1" /></td>
	</tr>
	</table>
</div>
</body>
</html>